const shopServ = require('../service/shopServ.js')

const shopCtrl = {
  goodsUNIlist: async (ctx) => {
    const res = await shopServ.goodsUNIlistServ()
    ctx.body = {
      code: 0,
      msg: 'success',
      data:res
    }
  },
  orderlist: async (ctx) => {
    let data = ctx.request.body
    const res = await shopServ.orderlistServ(data)
    ctx.body = {
      code: 0,
      msg: 'success',
      data:res
    }
  },
  goodslist: async (ctx) => {
    let data = ctx.request.body
    const res = await shopServ.goodslistServ(data)
    ctx.body = {
      code: 0,
      msg: 'success',
      data:res
    }
  },
  deliverInfo :async (ctx) =>{
    let data = ctx.request.body
     await shopServ.deliverInfoServ(data)
    ctx.body = {
      code: 0,
      msg: 'success',
    }
  },
  deleteorder:async (ctx) =>{
    let data = ctx.request.body
     await shopServ.deleteorderServ(data)
    ctx.body = {
      code: 0,
      msg: 'success',
    }
  },
  orderlistWeb:async (ctx) =>{
    let data = ctx.request.body
    const res = await shopServ.orderlistWebServ(data)
    ctx.body = {
      code: 0,
      msg: 'success',
      data: res
    }
  },
  editOrderStatusWeb:async (ctx) =>{
    let data = ctx.request.body
    await shopServ.editOrderStatusServ(data)
    ctx.body = {
      code: 0,
      msg: 'success',
    }
  },
  deleteGood:async (ctx) =>{
    let data = ctx.request.body
    await shopServ.deleteGoodWebServ(data)
    ctx.body = {
      code: 0,
      msg: 'success',
    }
  },
  editGood:async (ctx) =>{
    let data = ctx.request.body
    await shopServ.editGoodWebServ(data)
    ctx.body = {
      code: 0,
      msg: 'success',
    }
  },
  addGood:async (ctx) =>{
    let data = ctx.request.body
    await shopServ.addGoodWebServ(data)
    ctx.body = {
      code: 0,
      msg: 'success',
    }
  },
}

module.exports  = shopCtrl